﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="备件品种管理.aspx.cs" Inherits="syc.Jidong.备件品种管理" %>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server">
<asp:Label ID="SqlText" runat="server" Text="" Visible="false"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>"
onselected="SqlDataSource1_Selected" 
DeleteCommand="delete from 备品备件 where ID=@ID"
>
<DeleteParameters>
<asp:Parameter Name="ID" DbType="Int32" Size="4"/>
</DeleteParameters>
</asp:SqlDataSource>

<div id="wintop" class="wintop">备品备件品种管理</div>

<asp:Panel ID="Panel1" runat="server" CssClass="panel">
    <input type="button" value="录 入" class="button" onclick="parent.swin2_load('/JiDong/备件品种录入.aspx',600,379);"/>
    <asp:Button ID="Button_Edit" runat="server" Text="修 改" CssClass="button" UseSubmitBehavior="False"/>
    <asp:Button ID="Button_Delete" runat="server" Text="删 除" CssClass="button"  
        UseSubmitBehavior="False" 
        OnClientClick="if(!confirm('增加或删除品种需慎重，若无必要请不要随意增加或删除品种\n确认要删除该条记录吗？'))return(false);" 
        onclick="Button_Delete_Click" />
</asp:Panel>

<asp:Panel ID="Panel2" runat="server" CssClass="panel" GroupingText="品种查询">

品名：<asp:TextBox ID="PinMing" runat="server" CssClass="textbox" Width="80"></asp:TextBox>
<span style="margin-left:10px;"></span>
规格：<asp:TextBox ID="GuiGe" runat="server" CssClass="textbox" Width="80"></asp:TextBox>
<span style="margin-left:10px;"></span>
编码：<asp:TextBox ID="BianMa" runat="server" CssClass="textbox" Width="60"></asp:TextBox>
<span style="margin-left:10px;"></span>
简码：<asp:TextBox ID="JianMa" runat="server" CssClass="textbox" Width="60"></asp:TextBox>
<span style="margin-left:10px;"></span>
权重：<asp:TextBox ID="QuanZhong" runat="server" CssClass="textbox" Width="60"></asp:TextBox>
<span style="margin-left:10px;"></span>
<asp:Button ID="Button_Query" runat="server" Text="查 询" UseSubmitBehavior="false" 
        CssClass="mbutton" onclick="Button_Query_Click" />
<asp:Button ID="Button_Reset" runat="server" Text="清空条件" UseSubmitBehavior="false" 
        CssClass="mbutton" onclick="Button_Reset_Click" />
</asp:Panel>


<div class="gridframe">
<div class="gridview">
    <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
        <tr>
            <td class="grid-title">备品备件品种列表</td>
        </tr>
        <tr>
            <td class="grid-back">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                    DataSourceID="SqlDataSource1"
                    PageSize="10"
                    GridLines="None" ondatabound="GridView1_DataBound" 
                    onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                    UseAccessibleHeader="False" 
                    onselectedindexchanged="GridView1_SelectedIndexChanged">
                    <PagerSettings Visible="False" />
                    <RowStyle CssClass="grid-row-normal" />
                    <Columns>
                    
                        <asp:TemplateField HeaderText="">
                            <ItemTemplate>
                                <asp:Button ID="Button_xz" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="品名" SortExpression="品名">
                            <ItemTemplate>
                                <asp:Label ID="Label_pm" runat="server" Text='<%# Eval("品名") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Left" Width="120px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="型号/规格">
                            <ItemTemplate>
                                <asp:Label ID="Label_gg" runat="server" Text='<%# Eval("规格") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Left" Width="120px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="单位">
                            <ItemTemplate>
                                <asp:Label ID="Label_dw" runat="server" Text='<%# Eval("单位") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="单价(元)" SortExpression="单价">
                            <ItemTemplate>
                                <asp:Label ID="Label_dj" runat="server" Text='<%# Eval("单价") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="编码">
                            <ItemTemplate>
                                <asp:Label ID="Label_bm" runat="server" Text='<%# Eval("编码") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="简码">
                            <ItemTemplate>
                                <asp:Label ID="Label_jm" runat="server" Text='<%# Eval("简码") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="权重" SortExpression="权重">
                            <ItemTemplate>
                                <asp:Label ID="Label_qz" runat="server" Text='<%# Eval("权重") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="50px" />
                        </asp:TemplateField>
                    </Columns>
                    <SelectedRowStyle CssClass="grid-row-selected" />
                  </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>   
                <table width="100%">
                    <tr>
                        <td class="pagebar">
                            <asp:Button ID="Button_Pager_First" UseSubmitBehavior="false" runat="server" Text="" ToolTip="首页" 
                                CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                            <asp:Button ID="Button_Pager_Prev" UseSubmitBehavior="false" runat="server" Text="" ToolTip="上一页" 
                                CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                            <input type="button" class="page-split" UseSubmitBehavior="false" disabled />第<asp:TextBox 
                                ID="TextBox_Pager" AutoPostBack="True" runat="server" CssClass="pageturn" 
                                ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" disabled /><asp:Label ID="Label_Pages" UseSubmitBehavior="false" runat="server"></asp:Label><input type="button" class="page-split" disabled />
                            
                            <asp:Button ID="Button_Pager_Next" UseSubmitBehavior="false" runat="server" Text="" ToolTip="下一页" 
                                CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                            <asp:Button ID="Button_Pager_Last" UseSubmitBehavior="false" runat="server" Text="" ToolTip="末页" 
                                CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" /><asp:Label ID="Label9" runat="server"></asp:Label><input type="button" class="page-split" disabled />
                        </td>
                        <td class="pagebar" align="right">
                            <asp:Label ID="Label_Total" runat="server"></asp:Label>
                        </td>
                    </tr>
               </table>

            </td>
        </tr>
    </table>
    
</div>
</div>

</form>
<script>
    var notice = '<%=this.Notice %>';
    if (notice != '') {
        parent.showmsgbox(notice);
    }
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            //textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }
    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
            rows[i].onclick = selectRow;
        }
    }

    document.onkeydown = function(e) {
        if (!e) e = window.event;
        var tag = e.srcElement;
        if (!tag) tag = e.target;
        if (tag.tagName == "INPUT" && tag.className == "textbox" || tag.tagName == "SELECT") {
            if (e.keyCode == 13) e.keyCode = 9;
        }
    }

</script>
</body>
</html>
